import b_settings
import b_node
import b_position
import b_boundary
import b_velocity
import b_acceleration
import b_displacement
import b_material
import b_field
import b_load
import b_standard1D
import b_compression1D
import b_tension1D

class Data(object):
	def __init__(self, name="NewFile", dimensions=2, *arguments, **keywords):
		super(Data, self).__init__()
		
		self.name = name
		
		self.settings = b_settings.Settings(dimensions)
		
		N1 = b_node.Node(self, "N1", b_position.Position(self, [100,300]))
		N2 = b_node.Node(self, "N2", b_position.Position(self, [300,200]))
		N3 = b_node.Node(self, "N3", b_position.Position(self, [500,400]))
		N4 = b_node.Node(self, "N4", b_position.Position(self, [150,500]))
		
		self.nodes = {N1.name: N1, N2.name: N2, N3.name: N3, N4.name: N4}
		
		DefaultMaterial = b_material.Material(self, "DefaultMaterial")
		self.materials = {DefaultMaterial.name: DefaultMaterial}
		
		DefaultField = b_field.Field(self, "Standard Gravity")
		self.fields = {DefaultField.name: DefaultField}
		
		self.loads = {}
		
		M1 = b_standard1D.Standard1D(self, "M1", [N1, N2], DefaultMaterial)
		M2 = b_standard1D.Standard1D(self, "M2", [N2, N3], DefaultMaterial)
		M3 = b_standard1D.Standard1D(self, "M3", [N3, N4], DefaultMaterial)
		M4 = b_standard1D.Standard1D(self, "M4", [N4, N1], DefaultMaterial)
		M5 = b_standard1D.Standard1D(self, "M5", [N1, N3], DefaultMaterial)
		self.members = {M1.name: M1, M2.name: M2, M3.name: M3, M4.name: M4, M5.name: M5}
	
	def __repr__(self):
		return "{Data: {settings: %s, name: %s, nodes: %s, materials: %s, fields: %s, loads: %s, members: %s}}" % (self.settings, self.name, self.nodes, self.materials, self.fields, self.loads, self.members)
